<?php 
class ControllerCatalogProductSort extends Controller {
    private $error = array(); 
     
    public function index() {      
        $this->load->language('catalog/product_sort');                
        $this->document->title = $this->language->get('heading_titlec');         
        
        $this->load->model('catalog/product');        
        
        $url_page = '';
        if (isset($this->request->get['page'])) {
            $page = $this->request->get['page'];
            $url_page = '&page=' . $page;
        } else {
            $page = 1;
        }
        
        $url_sort = '';
        if (isset($this->request->get['sort'])) {
            $sort = $this->request->get['sort'];
            $url_sort = '&sort=' .$sort;
        } else {
            $sort = 'pd.name';
        }
        
        $url_order = '';
        if (isset($this->request->get['order'])) {
            $order = $this->request->get['order'];
            $url_order = '&order=' . $order;
        } else {
            $order = 'ASC';
            $url_order = '&order=' . $order;
        }

        if (isset($this->request->get['filter_name'])) {
            $filter_name = $this->request->get['filter_name'];
        } else {
            $filter_name = NULL;
        }

        if (isset($this->request->get['filter_model'])) {
            $filter_model = $this->request->get['filter_model'];            
        } else {
            $filter_model = NULL;
        }

        if (isset($this->request->get['filter_quantity'])) {
            $filter_quantity = $this->request->get['filter_quantity'];            
        } else {
            $filter_quantity = NULL;
        }

        if (isset($this->request->get['filter_category'])) {
            $filter_category = $this->request->get['filter_category'];            
        } else {
            $filter_category = NULL;
        }

        if (isset($this->request->get['filter_sku'])) {
            $filter_sku = $this->request->get['filter_sku'];            
        } else {
            $filter_sku = NULL;
        }

        if (isset($this->request->get['filter_manufacturer'])) {
            $filter_manufacturer = $this->request->get['filter_manufacturer'];           
        } else {
            $filter_manufacturer = NULL;
        }
        
        if (isset($this->request->get['filter_status'])) {
            $filter_status = $this->request->get['filter_status'];           
        } else {
            $filter_status = NULL;
        }
                                     
        if (isset($this->request->get['filter_price'])) {
            $filter_price = $this->request->get['filter_price'];            
        } else {
            $filter_price = NULL;
        }
                
        $url = $this->getFilter() . $url_sort . $url_order . $url_page;
         
        if($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validateForm()){ 
            if(isset($this->request->post['selected'])){
                $this->load->model('catalog/product_sort'); 
                $this->model_catalog_product_sort->editSortOrderCategory($this->request->post);
                  
                $this->session->data['success'] = $this->language->get('text_success'); 
            }
            else{
                $this->data['error_warning'] = 'Please select an item.';
            }
            
            $this->redirect(HTTPS_SERVER . 'index.php?route=catalog/product_sort' . $url . '&token=' . $this->session->data['token']);    
        }
        
        $this->document->breadcrumbs = array();

        $this->document->breadcrumbs[] = array(
            'href'      => HTTPS_SERVER . 'index.php?route=common/home&token=' . $this->session->data['token'],
            'text'      => $this->language->get('text_home'),
            'separator' => FALSE
        );

        $this->document->breadcrumbs[] = array(
            'href'      => HTTPS_SERVER . 'index.php?route=catalog/product_sort&token=' . $this->session->data['token'] . $url,
            'text'      => $this->language->get('heading_title'),
            'separator' => ' :: '
        );
         
        $data = array(
            'filter_name'           => $filter_name, 
            'filter_model'          => $filter_model,
            'filter_quantity'       => $filter_quantity,
            'filter_category'       => $filter_category,
            'filter_sku'            => $filter_sku,             
            'filter_status'         => $filter_status,
            'sort'                  => $sort,
            'order'                 => $order,
            'start'                 => ($page - 1) * $this->config->get('config_admin_limit'),
            'limit'                 => $this->config->get('config_admin_limit'),
            'filter_manufacturer'   => $filter_manufacturer,
            'filter_price'          => $filter_price,
        );         
           
        $product_total = $this->model_catalog_product->getTotalProducts($data);            
        $results = $this->model_catalog_product->getProducts($data);
       
        $this->load->model('tool/image');
        $this->load->model('catalog/category');
        //$this->data['categories'] = $this->model_catalog_category->getCategories(0);
        $this->data['categories'] = $this->model_catalog_category->getEnableCategories(0);

        $this->load->model('catalog/manufacturer');        
        $this->data['manufacturers'] = $this->model_catalog_manufacturer->getManufacturers();
        
        $this->data['products'] = array();   
        foreach ($results as $result) {
            /*
            $action = array();            
            $action[] = array(
                'text' => $this->language->get('text_save'),
                'href' => HTTPS_SERVER . 'index.php?route=catalog/product_sort&token=' . $this->session->data['token'] . '&product_id=' . $result['product_id'] . $url
            );
            */
            
            $category =  $this->model_catalog_product->getProductCategories($result['product_id']); 
            $manufacturer = $this->model_catalog_manufacturer->getManufacturer($result['manufacturer_id']);
            
            if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                $image = $this->model_tool_image->resize($result['image'], 40, 40);
            } else {
                $image = $this->model_tool_image->resize('no_image.jpg', 40, 40);
            }
            
            $this->load->model('catalog/product_sort');
            //$product_sort_order = $this->model_catalog_product->getSortOrderCategory($result['product_id']);                        
            $product_sort_order = $this->model_catalog_product_sort->getProductSortOrderByCategory($result['product_id'], $category);
            $sort_orders = array(); 
            foreach($product_sort_order as $sort_item){
                $sort_orders[] = $sort_item['category_id'];     
            }              
            $sort_orders = count($sort_orders) < count($category) ? $category : $sort_orders;
            
            $this->data['products'][] = array(
                'product_id'    => $result['product_id'],
                'name'          => $result['name'],
                'model'         => $result['model'],
                'category'      => $category,
                'sku'           => $result['sku'],                
                'image'         => $image,
                'quantity'      => $result['quantity'],
                'status'        => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),
                'selected'      => isset($this->request->post['selected']) && in_array($result['product_id'], $this->request->post['selected']),
                //'action'        => $action,
                //'manufacturer' => $manufacturer, 
                'manufacturer'  => isset($manufacturer['name']) ? $manufacturer['name'] : '', 
                'price'         => $result['price'],
                'ref_sort'      => $sort_orders,
                'sort_order'    => $product_sort_order
            );
        }
                       
        $this->data['heading_title'] = $this->language->get('heading_titlec');

        $this->data['text_enabled'] = $this->language->get('text_enabled');
        $this->data['text_disabled'] = $this->language->get('text_disabled');
        $this->data['text_no_results'] = $this->language->get('text_no_results');

        $this->data['column_image'] = $this->language->get('column_image');
        $this->data['column_name'] = $this->language->get('column_name');
        $this->data['column_model'] = $this->language->get('column_model');
        $this->data['column_category'] = $this->language->get('column_category');
        $this->data['column_sku'] = $this->language->get('column_sku');
        $this->data['column_quantity'] = $this->language->get('column_quantity');
        $this->data['column_status'] = $this->language->get('column_status');
        $this->data['column_action'] = $this->language->get('column_action');
        
        $this->data['button_save'] = $this->language->get('button_save');
        $this->data['button_filter'] = $this->language->get('button_filter');
 
        $this->data['token'] = $this->session->data['token'];
        
        if (isset($this->error['warning'])) {
            $this->data['error_warning'] = $this->error['warning'];
        } else {
            $this->data['error_warning'] = '';
        }

        if (isset($this->session->data['success'])) {
            $this->data['success'] = $this->session->data['success'];         
            unset($this->session->data['success']);
        } else {
            $this->data['success'] = '';
        }
        
        $url_order_change = $order == 'ASC' ? '&order=DESC' : '&order=ASC';
        $url = $this->getFilter() . $url_order_change . $url_page;
        $this->data['sort_name'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=pd.name' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_model'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=p.model' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_quantity'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=p.quantity' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_category'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=category' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_sku'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=p.sku' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_status'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=p.status' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_order'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=p.sort_order' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_manufacturer'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=manufacturer' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_price'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=p.price' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_sort_order'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=pcs.product_sort_order' . $url . '&token=' . $this->session->data['token'];        
        $this->data['sort_msort_order'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort&sort=pms.product_msort_order' . $url . '&token=' . $this->session->data['token'];        
      
        $url = $this->getFilter() . $url_sort . $url_order;
        $this->data['save'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort' . $url . $url_page . '&token=' . $this->session->data['token'];        
        
        $pagination = new Pagination();
        $pagination->total = $product_total; 
        $pagination->page = $page;
        $pagination->limit = $this->config->get('config_admin_limit');
        $pagination->text = $this->language->get('text_pagination');
        $pagination->url = HTTPS_SERVER . 'index.php?route=catalog/product_sort' . $url . '&page={page}&token=' . $this->session->data['token'];            
        $this->data['pagination'] = $pagination->render();
            
        $this->data['filter_name'] = $filter_name;
        $this->data['filter_model'] = $filter_model;
        $this->data['filter_category'] = $filter_category;
        $this->data['filter_sku'] = $filter_sku;
        $this->data['filter_manufacturer'] = $filter_manufacturer;  
        $this->data['filter_quantity'] = $filter_quantity;
        $this->data['filter_status'] = $filter_status;
        $this->data['filter_price'] = $filter_price;
        
        $this->data['sort'] = $sort;
        $this->data['order'] = $order;        

        $this->template = 'catalog/product_sort.tpl';
        $this->children = array(
            'common/header',    
            'common/footer'    
        );
        
        $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
    }
    
    public function manufacturer() {      
        $this->load->language('catalog/product_sort');                
        $this->document->title = $this->language->get('heading_titlem');         
        
        $this->load->model('catalog/product');        
        
        $url_page = '';
        if (isset($this->request->get['page'])) {
            $page = $this->request->get['page'];
            $url_page = '&page=' . $page;
        } else {
            $page = 1;
        }
        
        $url_sort = '';
        if (isset($this->request->get['sort'])) {
            $sort = $this->request->get['sort'];
            $url_sort = '&sort=' .$sort;
        } else {
            $sort = 'pd.name';
        }
        
        $url_order = '';
        if (isset($this->request->get['order'])) {
            $order = $this->request->get['order'];
            $url_order = '&order=' . $order;
        } else {
            $order = 'ASC';
            $url_order = '&order=' . $order;
        }
                
        if (isset($this->request->get['filter_name'])) {
            $filter_name = $this->request->get['filter_name'];
        } else {
            $filter_name = NULL;
        }

        if (isset($this->request->get['filter_model'])) {
            $filter_model = $this->request->get['filter_model'];            
        } else {
            $filter_model = NULL;
        }

        if (isset($this->request->get['filter_quantity'])) {
            $filter_quantity = $this->request->get['filter_quantity'];            
        } else {
            $filter_quantity = NULL;
        }

        if (isset($this->request->get['filter_category'])) {
            $filter_category = $this->request->get['filter_category'];           
        } else {
            $filter_category = NULL;
        }

        if (isset($this->request->get['filter_sku'])) {
            $filter_sku = $this->request->get['filter_sku'];            
        } else {
            $filter_sku = NULL;
        }

        if (isset($this->request->get['filter_manufacturer'])) {
            $filter_manufacturer = $this->request->get['filter_manufacturer'];           
        } else {
            $filter_manufacturer = NULL;
        }
        
        if (isset($this->request->get['filter_status'])) {
            $filter_status = $this->request->get['filter_status'];           
        } else {
            $filter_status = NULL;
        }
        
        if (isset($this->request->get['filter_price'])) {
            $filter_price = $this->request->get['filter_price'];            
        } else {
            $filter_price = NULL;
        }
        
        $url = $this->getFilter() . $url_sort . $url_order . $url_page;

        if($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validateForm()){ 
            if(isset($this->request->post['selected'])){
                $this->load->model('catalog/product_sort'); 
                $this->model_catalog_product_sort->editSortOrderManufacturer($this->request->post);
                  
                $this->session->data['success'] = $this->language->get('text_success'); 
            }
            else{
                $this->data['error_warning'] = 'Please select an item.';
            }
            
            $this->redirect(HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer' . $url . '&token=' . $this->session->data['token']);    
        }
        
        $this->document->breadcrumbs = array();

        $this->document->breadcrumbs[] = array(
            'href'      => HTTPS_SERVER . 'index.php?route=common/home&token=' . $this->session->data['token'],
            'text'      => $this->language->get('text_home'),
            'separator' => FALSE
        );

        $this->document->breadcrumbs[] = array(
            'href'      => HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&token=' . $this->session->data['token'] . $url,
            'text'      => $this->language->get('heading_title'),
            'separator' => ' :: '
        );
         
        $data = array(
            'filter_name'           => $filter_name, 
            'filter_model'          => $filter_model,
            'filter_quantity'       => $filter_quantity,
            'filter_category'       => $filter_category,
            'filter_sku'            => $filter_sku,             
            'filter_status'         => $filter_status,
            'sort'                  => $sort,
            'order'                 => $order,
            'start'                 => ($page - 1) * $this->config->get('config_admin_limit'),
            'limit'                 => $this->config->get('config_admin_limit'),
            'filter_manufacturer'   => $filter_manufacturer,
            'filter_price'          => $filter_price,
        );         
        
        $this->load->model('tool/image');
        $this->load->model('catalog/category');
        $this->load->model('catalog/manufacturer');
        $this->load->model('catalog/product_sort');
        
        //$product_total = $this->model_catalog_product->getTotalProducts($data);            
        //$results = $this->model_catalog_product->getProducts($data);
        $product_total = $this->model_catalog_product_sort->getTotalProducts($data);            
        $results = $this->model_catalog_product_sort->getProducts($data);
        
        //$this->data['categories'] = $this->model_catalog_category->getCategories(0);
        //$this->data['categories'] = $this->model_catalog_category->getEnableCategories(0);
        $this->data['categories'] =  $this->model_catalog_category->getAllCategories(0);                          
        $this->data['manufacturers'] = $this->model_catalog_manufacturer->getManufacturers();
        
        $this->data['products'] = array();   
        foreach ($results as $result) {
            /*
            $action = array();            
            $action[] = array(
                'text' => $this->language->get('text_save'),
                'href' => HTTPS_SERVER . 'index.php?route=catalog/product_sort&token=' . $this->session->data['token'] . '&product_id=' . $result['product_id'] . $url
            );
            */
            
            $category =  $this->model_catalog_product->getProductCategories($result['product_id']);            
            $manufacturer = $this->model_catalog_manufacturer->getManufacturer($result['manufacturer_id']);
            
            if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                $image = $this->model_tool_image->resize($result['image'], 40, 40);
            } else {
                $image = $this->model_tool_image->resize('no_image.jpg', 40, 40);
            }                       
            
            /*
            $product_sort_order_c = $this->model_catalog_product_sort->getProductSortOrderByCategory($result['product_id'], $category);
            $sort_orders_c = array();
            foreach($product_sort_order_c as $sort_item){
                $sort_orders_c[] = $sort_item['category_id'];     
            }              
            $sort_orders_c = count($sort_orders_c) < count($category) ? $category : $sort_orders_c;
            */
            
            //$product_sort_order_m = $this->model_catalog_product->getSortOrderManufacturer($result['product_id']);                        
            $product_sort_order_m = $this->model_catalog_product_sort->getProductSortOrderByManufacturer($result['product_id'], $result['manufacturer_id'], $filter_category);            
            if(empty($product_sort_order_m)){
                $product_sort_order_m['product_msort_order']    = 0;
                $product_sort_order_m['msort_id']               = 0;
                $product_sort_order_m['category_id'] = $filter_category;
            }            
            
            $this->data['products'][] = array(
                'product_id'        => $result['product_id'],
                'name'              => $result['name'],
                'model'             => $result['model'],
                'category_name'     => $result['category'],                
                'category'          => $category,
                'sku'               => $result['sku'],                
                'image'             => $image,
                'quantity'          => $result['quantity'],
                'status'            => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),
                'selected'          => isset($this->request->post['selected']) && in_array($result['product_id'], $this->request->post['selected']),
                //'action'          => $action,
                'manufacturer'      => $manufacturer,                 
                'price'             => $result['price'],                
                //'sort_order_c'      => $sort_orders_c,
                'sort_order_m'      => $product_sort_order_m,
            );
        }
         
        $this->data['heading_title'] = $this->language->get('heading_titlem');

        $this->data['text_enabled'] = $this->language->get('text_enabled');
        $this->data['text_disabled'] = $this->language->get('text_disabled');
        $this->data['text_no_results'] = $this->language->get('text_no_results');

        $this->data['column_image'] = $this->language->get('column_image');
        $this->data['column_name'] = $this->language->get('column_name');
        $this->data['column_model'] = $this->language->get('column_model');
        $this->data['column_category'] = $this->language->get('column_category');
        $this->data['column_sku'] = $this->language->get('column_sku');
        $this->data['column_quantity'] = $this->language->get('column_quantity');
        $this->data['column_status'] = $this->language->get('column_status');
        $this->data['column_action'] = $this->language->get('column_action');
        
        $this->data['button_save'] = $this->language->get('button_save');
        $this->data['button_filter'] = $this->language->get('button_filter');
 
        $this->data['token'] = $this->session->data['token'];
        
        if (isset($this->error['warning'])) {
            $this->data['error_warning'] = $this->error['warning'];
        } else {
            $this->data['error_warning'] = '';
        }

        if (isset($this->session->data['success'])) {
            $this->data['success'] = $this->session->data['success'];         
            unset($this->session->data['success']);
        } else {
            $this->data['success'] = '';
        }
                  
        $url_order_change = $order == 'ASC' ? '&order=DESC' : '&order=ASC';
        $url = $this->getFilter() . $url_order_change . $url_page;
        $this->data['sort_name'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=pd.name' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_model'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=p.model' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_quantity'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=p.quantity' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_category'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=category' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_sku'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=p.sku' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_status'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=p.status' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_order'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=p.sort_order' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_manufacturer'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=manufacturer' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_price'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=p.price' . $url . '&token=' . $this->session->data['token'];
        $this->data['sort_sort_order'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=pcs.product_sort_order' . $url . '&token=' . $this->session->data['token'];        
        $this->data['sort_msort_order'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer&sort=pms.product_msort_order' . $url . '&token=' . $this->session->data['token'];        
                
        $url = $this->getFilter() . $url_sort . $url_order;
        $this->data['save'] = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer' . $url . $url_page . '&token=' . $this->session->data['token'];        
          
        $pagination = new Pagination();
        $pagination->total = $product_total; 
        $pagination->page = $page;
        $pagination->limit = $this->config->get('config_admin_limit');
        $pagination->text = $this->language->get('text_pagination');
        $pagination->url = HTTPS_SERVER . 'index.php?route=catalog/product_sort/manufacturer' . $url . '&page={page}&token=' . $this->session->data['token'];            
        $this->data['pagination'] = $pagination->render();
            
        $this->data['filter_name'] = $filter_name;
        $this->data['filter_model'] = $filter_model;
        $this->data['filter_category'] = $filter_category;
        $this->data['filter_sku'] = $filter_sku;
        $this->data['filter_manufacturer'] = $filter_manufacturer;  
        $this->data['filter_quantity'] = $filter_quantity;
        $this->data['filter_status'] = $filter_status;
        $this->data['filter_price'] = $filter_price;
        
        $this->data['sort'] = $sort;
        $this->data['order'] = $order;        

        $this->template = 'catalog/product_msort.tpl';
        $this->children = array(
            'common/header',    
            'common/footer'    
        );
         
        $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
    }
    
    private function validateForm() { 
        if (!$this->user->hasPermission('modify', 'catalog/product_sort')) {
              $this->error['warning'] = $this->language->get('error_permission');  
        }
        
        if (!$this->error) {
            return true;
        } 
        else {
            return false;
        }
    } 
    
    private function getFilter(){
        $url_filter = '';
        
        if (isset($this->request->get['filter_name'])) {            
            $url_filter .= '&filter_name=' . $this->request->get['filter_name'];            
        }

        if (isset($this->request->get['filter_model'])) {           
            $url_filter .= '&filter_model=' . $this->request->get['filter_model']; 
        } 
        
        if (isset($this->request->get['filter_quantity'])) {            
            $url_filter .= '&filter_quantity=' . $this->request->get['filter_quantity'];
        } 
        
        if (isset($this->request->get['filter_category'])) {            
            $url_filter .= '&filter_category=' . $this->request->get['filter_category']; 
        } 

        if (isset($this->request->get['filter_sku'])) {          
            $url_filter .= '&filter_sku=' . $this->request->get['filter_sku'];
        } 
        
        if (isset($this->request->get['filter_manufacturer'])) {            
            $url_filter .= '&filter_manufacturer=' . $this->request->get['filter_manufacturer'];
        } 
        
        if (isset($this->request->get['filter_status'])) {        
            $url_filter .= '&filter_status=' . $this->request->get['filter_status'];
        }
        
        if (isset($this->request->get['filter_price'])) {        
            $url_filter .= '&filter_price=' . $this->request->get['filter_price']; 
        } 
        
        return $url_filter;
    }   
}
?>
